This present invention relates to computer networking, and more particularly to a network adapter and method for emulating large-block transfers to an attached host.
The rapid growth in computer networking has spurred the development of ever-faster network media rates. For instance, over the last ten years, Ethernet-format maximum media rates have gone from 10 megabits-per-second (Mbps), to 100 Mbps (fast Ethernet), and now to 1000 Mbps (gigabit Ethernet). Future increases are planned to allow even faster network communications.
Traditionally, networked host computers have handled communication tasks at the network and transport layers (and some tasks at the link layer) using host software, while leaving the remaining link and physical layer communication tasks to an attached network adapter (which also may be partially implemented in host-resident driver software). Thus for virtually every packet transmitted or received by the network adapter, the host processor must expend resources in handling packetization, header manipulation, data acknowledgement, and error control. At gigabit Ethernet speeds, even sophisticated server systems will often have a maximum network transmission rate limited by the ability of the host processor to handle its network and transport layer tasks, rather than by the speed of the physical connection. Consequently, host-implemented networking tasks can reduce bandwidth utilization and occupy processor throughput that could otherwise be devoted to running applications.
Some network adapter vendors have attempted to increase network performance by offloading the entire transport and lower-layer protocol stack to the network adapter. This approach greatly eases the burden on the host processor, but increases the complexity and expense of the adapter. It also limits flexibility, limits upgradability, and makes platform-specific tailoring difficult. Such an adapter may also require that the entire network stack be rewritten to allow the hardware solution to integrate with the operating system.
Several less-severe modifications to the traditional division of labor between a host processor and a network adapter have also been proposed. One of the more appealing of these proposals is a feature known as xe2x80x9cTCP segmentation offloadxe2x80x9d (See the Microsoft Windows 2000 -Device Driver Development Kit for detailed information. Transmission Control Protocol/Internet Protocol (TCP/IP) is perhaps the most popular transport/network layer protocol suite in use today. See Network Working Group, RFC 791, Internet Protocol (1981); Network Working Group, RFC 793, Transmission Control Protocol (1981)). With TCP segmentation offload, the host processor can indicate to the network adapter that a large block of data is ready for TCP transmission, rather than passing numerous smaller TCP packets (each containing part of the large block of data) to the network adapter. With offloading, the network adapter segments the block of data into the smaller packets, builds the TCP, IP, and link-layer headers for each packet, and transmits the packets.
TCP segmentation offload benefits overall system performance due to several factors. First, sending a large block of data requires fewer calls down through the software protocol stack than does sending multiple small blocks, thus reducing CPU utilization for a given workload. Second, when the headers are built in the network adapter hardware, header-building host overhead is avoided, and header information must only be transferred across the host bus once per block rather than once per packet, reducing latency and lowering bus utilization. And third, the network adapter hardware can reduce the number of host interrupts that it generates in order to indicate data transmission, in some instances down to one per block.
I have now recognized that, despite its benefits, TCP segmentation offload has several drawbacks. One drawback is that because the capability has been developed to operate with a single operating system vendor""s software, network adapter hardware and driver modifications that allow offloading do not work with other vendor""s operating systems. A second drawback is that the offload capability is one-way (transmit) only. A third drawback is that despite the offload capability, the host cannot offload a data block larger than the remote endpoint""s receive window size.
In accordance with one aspect of the present invention, a method for operating a network adapter is disclosed. According to this method, the network adapter intercepts connection negotiation packets passing between the transmission control protocol layer and a remote endpoint. The network adapter modifies the maximum segment size of the packets as necessary such that the transmission control protocol layer receives an indication that the remote endpoint has accepted a first maximum segment size for the connection, and the remote endpoint receives an indication that the host computer has accepted a second, smaller maximum segment size for the connection. Thereafter, upon receiving a request from the transmission control protocol layer to transfer an original data packet larger than the second maximum segment size to the remote endpoint over the connection, the network adapter segments the original data packet into multiple secondary data packets, each having a size no greater than the second maximum segment size. These secondary packets are transmitted by the network adapter to the remote endpoint.
In another aspect of the invention, a network adapter is disclosed. The network adapter comprises a network interface and a packet buffer memory to buffer packets for transmission over the network interface. A connection parameter manager, also part of the network adapter, negotiates for a given connection a first maximum segment size with a local host and a second, smaller maximum segment size with a remote endpoint. The network adapter also has a context engine that establishes and services a connection context when the local host requests transmission over the connection of a data packet having a size greater than the remote endpoint""s maximum segment size. The network adapter also has a packet engine to segment the data packet into multiple secondary data packets, each having a size no greater than the remote endpoint""s maximum receive segment size, and place these secondary packets into the packet buffer memory.
Also, an article of manufacture comprising a computer-readable medium containing a driver program for a network adapter is disclosed. When executed, the driver program configures a processor to run a connection parameter manager to negotiate, for a connection, a first maximum segment size with a local host and a second, smaller maximum segment size with a remote endpoint. When executed, the driver program also configures a processor to run a context scheduler to match host-originated data packets to the connection and request a packet segmentation context on the network adapter when a matched data packet is larger than the second maximum segment size.